require "migration_helpers"
class CreateTableOfContents < ActiveRecord::Migration
  extend MigrationHelpers
  def self.up
    create_table :table_of_contents do |t|
      t.column :parent_id, :integer
      t.column :inde, :string
      t.column :title, :string
      t.column :page, :integer
      t.column :meta_id, :integer
    end
    foreign_key(:table_of_contents, :parent_id, :table_of_contents)
    foreign_key(:table_of_contents, :meta_id, :metas)
  end

  def self.down
    drop_table :table_of_contents
  end
end
